//
//  HomeViewController.m
//  quickDoctor
//
//  Created by zhaowei on 17/3/8.
//  Copyright © 2017年 SWS. All rights reserved.
//

#import "HomeViewController.h"
#import "WeatherView.h"
#import "SJPDepartmentView.h"

@interface HomeViewController ()

@end

@implementation HomeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setupUI];
}
- (void)setupUI {
    self.view.backgroundColor = [UIColor whiteColor];
    
    self.title = @"马医一生";
     self.navigationController.navigationBar.barTintColor = kThemeColor;
    
    //先添加一个view
    WeatherView *weaView = [[WeatherView alloc] init];
    weaView.backgroundColor = [UIColor blueColor];
    [self.view addSubview:weaView];
    
    //布局
    [weaView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.offset(64);
        make.leading.trailing.offset(0);
        make.height.mas_equalTo(80);
    }];
    
    
    
    
    
    
    
    
    
    
    
    
    [self setupDepartmentView];
    
    
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
























































#pragma
#pragma-添加department控制器

- (void)setupDepartmentView
{
    //设置frame
    CGFloat viewY = self.view.height / 2;
    
    SJPDepartmentView *departmentView = [[SJPDepartmentView alloc]initWithFrame:CGRectMake(0, viewY, self.view.width, self.view.height/2)];
    
    [self.view addSubview:departmentView];
    departmentView.backgroundColor = [UIColor lightGrayColor];
    [self addChildViewController:departmentView.childContrller];
    
    
    
}

@end
